/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "tes_historial_docupago")
//@NamedQueries({@NamedQuery(name = "HistorialDocupago.findAll", query = "SELECT h FROM HistorialDocupago h"), @NamedQuery(name = "HistorialDocupago.findByFkDocCodigodpa", query = "SELECT h FROM HistorialDocupago h WHERE h.fkDocCodigodpa = :fkDocCodigodpa"), @NamedQuery(name = "HistorialDocupago.findByHdpFecha", query = "SELECT h FROM HistorialDocupago h WHERE h.hdpFecha = :hdpFecha"), @NamedQuery(name = "HistorialDocupago.findByHdpEstado", query = "SELECT h FROM HistorialDocupago h WHERE h.hdpEstado = :hdpEstado")})
public class HistorialDocupago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "fk_doc_codigodpa", nullable = false)
    private Long fkDocCodigodpa;
    @Basic(optional = false)
    @Column(name = "hdp_fecha", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date hdpFecha;
    @Basic(optional = false)
    @Column(name = "hdp_estado", nullable = false)
    private int hdpEstado;
    @JoinColumn(name = "fk_doc_codigo", referencedColumnName = "fk_doc_codigo", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private DocumentoPago fkDocCodigo;

    public HistorialDocupago() {
    }

    public HistorialDocupago(Long fkDocCodigodpa) {
        this.fkDocCodigodpa = fkDocCodigodpa;
    }

    public HistorialDocupago(Long fkDocCodigodpa, Date hdpFecha, int hdpEstado) {
        this.fkDocCodigodpa = fkDocCodigodpa;
        this.hdpFecha = hdpFecha;
        this.hdpEstado = hdpEstado;
    }

    public Long getFkDocCodigodpa() {
        return fkDocCodigodpa;
    }

    public void setFkDocCodigodpa(Long fkDocCodigodpa) {
        this.fkDocCodigodpa = fkDocCodigodpa;
    }

    public Date getHdpFecha() {
        return hdpFecha;
    }

    public void setHdpFecha(Date hdpFecha) {
        this.hdpFecha = hdpFecha;
    }

    public int getHdpEstado() {
        return hdpEstado;
    }

    public void setHdpEstado(int hdpEstado) {
        this.hdpEstado = hdpEstado;
    }

    public DocumentoPago getDocumentoPago() {
        return fkDocCodigo;
    }

    public void setDocumentoPago(DocumentoPago documentoPago) {
        this.fkDocCodigo = documentoPago;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fkDocCodigodpa != null ? fkDocCodigodpa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistorialDocupago)) {
            return false;
        }
        HistorialDocupago other = (HistorialDocupago) object;
        if ((this.fkDocCodigodpa == null && other.fkDocCodigodpa != null) || (this.fkDocCodigodpa != null && !this.fkDocCodigodpa.equals(other.fkDocCodigodpa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.HistorialDocupago[fkDocCodigodpa=" + fkDocCodigodpa + "]";
    }

}
